# Copyright (c) 2019 Presto Labs Pte. Ltd.
# Author: jaewon

from experimental.prophet.graph import graph
from experimental.prophet.kernels.printer import Printer


def printer(*values, use_logger=False):
  if isinstance(values[0], str):
    format_str = values[0]
    values = values[1:]
  else:
    format_str = ' '.join(['%s'] * len(values))

  values = [graph.as_variable(var) for var in values]
  node = graph.create_node('Printer',
                           values,
                           attrs={
                               'format_str': format_str, 'use_logger': use_logger
                           })
